package com.jweb.plugins.rpc.impl.iface;

import java.util.Map;

import com.jweb.plugins.rpc.bean.RpcRequest;
import com.jweb.plugins.rpc.bean.RpcResponse;
import com.jweb.plugins.rpc.bean.Service;

public interface IAgreement {

	/**
	 * 服务端发布服务
	 * 
	 * @param watcher
	 * @param handler
	 * @param host
	 * @param port
	 * @throws Exception
	 */
	void opServer(IWatcher watcher, Map<String, Service> handler, String host, int port) throws Exception;

	/**
	 * 客户端调用服务
	 * 
	 * @param request
	 * @param host
	 * @param port
	 * @return
	 * @throws Exception
	 */
	RpcResponse opClient(RpcRequest request, String host, int port) throws Exception;

}
